package controller;

import entity.Brand;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.BrandService;

@WebServlet(urlPatterns = {"/BrandListServlet"})
public class BrandList extends HttpServlet {

    BrandService brandService = new BrandService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Brand> brandList = brandService.selectAllBrand();
        req.setAttribute("brandList", brandList);
        req.getRequestDispatcher("brand.jsp").forward(req, resp);
    }

}
